package com.ruoyi.review.service.impl;

import com.ruoyi.review.domain.ReviewContent;
import com.ruoyi.review.mapper.ReviewContentMapper;
import com.ruoyi.review.service.IReviewContentService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * @Classname IreviewContentServiceImpl
 * @Description
 * @Date 2025/5/22 18:45
 * @Created by 小哲
 */
@Service
public class IReviewContentServiceImpl implements IReviewContentService {
    @Autowired
    private ReviewContentMapper reviewContentMapper;
    @Override
    public void insert(ReviewContent reviewContent) {
        ReviewContent insert = reviewContentMapper.insert(reviewContent);
    }

    @Override
    public void delete(String id) {
        reviewContentMapper.deleteById(id);
    }

    @Override
    public void updata(ReviewContent reviewContent) {
        reviewContentMapper.save(reviewContent);
    }

    @Override
    public List<ReviewContent> list() {
        return reviewContentMapper.findAll();
    }

    @Override
    public ReviewContent getById(String id) {
        return reviewContentMapper.findById(id).orElse(new ReviewContent());
    }
}
